package com.heatup.apt.common.dao;

import com.baomidou.mybatisplus.mapper.*;
import com.heatup.apt.model.course.CourseCoach;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.*;

import java.util.*;

/**
 * CourseCoach 表数据库控制层接口
 */
@Component
public interface CourseCoachMapper extends AutoMapper<CourseCoach> {

    /**
     * 根据课程ID删除课程教练关联信息
     *
     * @param courseId
     * @return
     */
    @Delete({
            "delete from course_coach",
            "where course_id = #{id,jdbcType=INTEGER}"
    })
    int deleteByCourseId(Integer courseId);

    //根据courseID来更新其它字段
    int updateByCourseId(CourseCoach record);

    List<CourseCoach> selectByCourseId(Integer courseId);

    /**
     *@Author: timo
     *@Date: 2018/4/3 15:06
     *@Description:
     * 查询课程教练的名称
     *
     */
    List<String> queryCourseCoachNameByCourseId(Integer courseId);
}